﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using TERP.WaterClient.Common;
using TERP.WaterClient.DbServices;

namespace TERP.WaterClient.Views.Water
{
    public partial class FrmRptViewReportByConditionTotalStockOut : FrmMdiBase
    {
        void InitControl()
        {
            //FromDate
            dedFromDate.EditValue = DateTime.Now;
            dedFromDate.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            dedFromDate.Properties.DisplayFormat.FormatString = Nonsense.DATE_FORMAT;
            dedFromDate.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            dedFromDate.Properties.EditFormat.FormatString = Nonsense.DATE_FORMAT;
            dedFromDate.Properties.EditMask = Nonsense.DATE_FORMAT;
            dedFromDate.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            dedFromDate.Properties.Mask.UseMaskAsDisplayFormat = true;

            //ToDate
            dedToDate.EditValue = DateTime.Now;
            dedToDate.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            dedToDate.Properties.DisplayFormat.FormatString = Nonsense.DATE_FORMAT;
            dedToDate.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime;
            dedToDate.Properties.EditFormat.FormatString = Nonsense.DATE_FORMAT;
            dedToDate.Properties.EditMask = Nonsense.DATE_FORMAT;
            dedToDate.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            dedToDate.Properties.Mask.UseMaskAsDisplayFormat = true;

        }

        public FrmRptViewReportByConditionTotalStockOut()
        {
            InitializeComponent();

            InitControl();
        }

        private void FrmRptViewReportByCondition_Load(object sender, EventArgs e)
        {

        }

        private void btnViewReport_Click(object sender, EventArgs e)
        {
            DataTable dtReport=new DataTable();		   
			StockOutService _stockOutService = new StockOutService();
			dtReport = _stockOutService.Its_StockOut_Get_Rpt(""
															, ""
															, ""
															, ""
															, ""
															, ""
															).Tables[DbTable.Tbl_StockOut];

			Report.FrmReportShow frm = new TERP.WaterClient.Report.FrmReportShow(
																				 dtReport
																				 , ReportView.RptView_Water_ChungTuGhiSo
																				 , ""//strFromDateToDate
																				 );
			frm.Show();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
